Analysis of separate coil data (chris)

In [1]:
import numpy as np
import numpy.linalg as nla
import matplotlib.pyplot as plt
import nibabel as nib
import os
%matplotlib inline
In [2]:
path = '/home/snarles/predator'
In [3]:
#os.listdir(path + '/8631_5_1_pfile/coil_images')
In [4]:
bvecs = np.loadtxt(path + '/chris1_bvec.csv', delimiter = ' ').T
b0_inds = list(np.where(np.array([nla.norm(v) for v in bvecs]) == 0)[0])
b0_inds
Out[4]:
[0, 1, 16, 31, 46, 61, 75, 90, 105, 120, 135, 149]
In [20]:
c0 = nib.load(path + '/8631_5_1_pfile/coil_images/coil_comb_ec.nii.gz').get_data()
c0 = c0[:, :, :, b0_inds]
In [6]:
c0_mu = np.mean(c0, axis = 3)
In [19]:
figsize_ = (3, 3)
z_inds = [10, 20, 30, 40, 50]
In [13]:
np.min(c0[:, :, :, 2][:] - c0_mu[:]), np.max(c0[:, :, :, 2][:] - c0_mu[:])
Out[13]:
(-22.291252, 10.610106)

Low-frequency noise in combined coil

left to right is z, up to down is time

In [18]:
vmin_2 = -20.0
vmax_2 = 10.0
w_inds = range(10)
#z_inds = [12, 14, 16, 18, 20]
figsize_2 = (len(z_inds) * figsize_[0], len(w_inds) * figsize_[1])
f_c1, axarr = plt.subplots(len(w_inds), len(z_inds), sharex=True, sharey=True, figsize = figsize_2)
for i in range(len(w_inds)):
    w_ind = w_inds[i]
    for j in range(len(z_inds)):
        z_ind = z_inds[j]
        axarr[i, j].imshow(c0[:, :, z_ind, w_ind] - c0_mu[:, :, z_ind], cmap='bone', vmin = vmin_2, vmax = vmax_2)

left to right is z, up to down is time

In [26]:
vmin_2 = -20.0
vmax_2 = 10.0
w_inds = range(10)
z_inds = [18, 19, 20, 21, 22, 23, 24, 25, 26]
figsize_2 = (len(z_inds) * figsize_[0], 2 * len(w_inds) * figsize_[1])
f_c1, axarr = plt.subplots(len(w_inds), len(z_inds), sharex=True, sharey=True, figsize = figsize_2)
for i in range(len(w_inds)):
    w_ind = w_inds[i]
    for j in range(len(z_inds)):
        z_ind = z_inds[j]
        axarr[i, j].imshow(c0[:, :60, z_ind, w_ind] - c0_mu[:, :60, z_ind], cmap='bone', vmin = vmin_2, vmax = vmax_2)

flipped axis: left to right is time, up/down is z

In [27]:
vmin_2 = -20.0
vmax_2 = 10.0
w_inds = range(10)
z_inds = [18, 19, 20, 21, 22, 23, 24, 25, 26]
figsize_2 = (len(z_inds) * figsize_[0], 2 * len(w_inds) * figsize_[1])
f_c1, axarr = plt.subplots(len(z_inds), len(w_inds), sharex=True, sharey=True, figsize = figsize_2)
for i in range(len(w_inds)):
    w_ind = w_inds[i]
    for j in range(len(z_inds)):
        z_ind = z_inds[j]
        axarr[j, i].imshow(c0[:, :60, z_ind, w_ind] - c0_mu[:, :60, z_ind], cmap='bone', vmin = vmin_2, vmax = vmax_2)
In []: